package com.binguo.wxapi.controller;

import com.binguo.wxapi.service.WXPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class WXPayController {

    @Autowired
    WXPayService wxPayService;


    @RequestMapping("/api/wxapp/doPay")
    public String doPay(HttpServletRequest request, HttpServletResponse response, Model model){
        return wxPayService.doPay(request, response, model);
    }

    @RequestMapping(value = "/api/wxapp/callback")
    public String wxpay(Model model, HttpServletRequest request, HttpServletResponse response){
        return wxPayService.wxpay(model, request);
    }



}